package com.neusoft.tyut.elm.util;

import java.util.Random;

public class AuthcodeTool {
	private static final Random RANDOM =new Random(  System.currentTimeMillis()  );
	public static final String AUTHCODE = "authcode";
	public static String authcode() {		 
		 StringBuffer  sb =new StringBuffer();
		 char[] chars= {'a','b','c','d','e','f','g','0','1','2','3','4','5','6','7','8','9'};
//		 26 +26 ,52
		for(int  i = 0 ;i <4;i++) {
			 int r =  RANDOM.nextInt(chars.length);
//			 if (r <26) {
//				 r+=65;
//			 }else {
//				 r+=97;
//			 }
//			 char c = (char )r ;
			 char c =  chars[r];
			 System.out.println(c );
			 sb.append(c);
		}
		String authcode =  sb.toString();
		return authcode;
		
	}

}
